package com.example.demo.service.impl;

import com.example.demo.dao.IRoomCountDao;
import com.example.demo.entity.RoomCount;
import com.example.demo.service.IRoomCountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomCountServiceImpl implements IRoomCountService {

	@Autowired
	private IRoomCountDao roomCountDao;

	@Override
	public void insert(RoomCount roomCount) {

		roomCountDao.insert(roomCount);

	}

	@Override
	public void update(RoomCount roomCount) {
		roomCountDao.update(roomCount);
	}

	@Override
	public void delete(int id) {
		roomCountDao.delete(id);
	}

	@Override
	public RoomCount selectById(int id) {

		return roomCountDao.selectById(id);
	}

	@Override
	public List<RoomCount> selectAll() {
		return roomCountDao.selectAll();
	}

	@Override
	public List<RoomCount> selectByType(String type) {
		return roomCountDao.selectByType(type);
	}

	@Override
	public void updateStatus(Integer roomId) {
		roomCountDao.updateStatus(roomId);
	}

	@Override
	public void updateStatusToZero(Integer roomId) {
		roomCountDao.updateStatusToZero(roomId);
	}
}
